import xadmin
from course.models import Course, Chapter, Video


class CourseAdmin:
    list_display = ('name', 'description', 'detail', 'level', 'duration', 'students', 'clicks', 'collections')
    search_fields = ('name', 'description', 'detail', 'level', 'students', 'clicks', 'collections')
    list_filter = ('name', 'description', 'detail', 'level', 'duration', 'students', 'clicks', 'collections')


class ChapterAdmin:
    list_display = ('course', 'name', 'created')
    search_fields = ('course', 'name')
    list_filter = ('course__name', 'name', 'created')


class VideoAdmin:
    list_display = ('chapter', 'name', 'created')
    search_fields = ('course', 'name')
    list_filter = ('chapter__name', 'name', 'created')


xadmin.site.register(Course, CourseAdmin)
xadmin.site.register(Chapter, ChapterAdmin)
xadmin.site.register(Video, VideoAdmin)
